/*
 * @(#)Xfsl.java        1.0 2000/05/09
 *
 * This file is part of Xfuzzy 3.0, a design environment for fuzzy logic
 * based systems.
 *
 * (c) 2000 IMSE-CNM. The authors may be contacted by the email address:
 *                    xfuzzy-team@imse.cnm.es
 *
 * Xfuzzy is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation.
 *
 * Xfuzzy is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

package xfuzzy.xfsl.view.listener;

import xfuzzy.xfsl.view.Xfsl;

import java.awt.event.*;

/**
 * Controlador de eventos de los botones
 * 
 * @author Francisco Jos� Moreno Velo
 *
 */
public class XfslActionListener implements ActionListener {

	//----------------------------------------------------------------------------//
	//                            MIEMBROS PRIVADOS                               //
	//----------------------------------------------------------------------------//

	/**
	 * Ventana principal de la herramienta xfsl
	 */
	private Xfsl frame;

	//----------------------------------------------------------------------------//
	//                                CONSTRUCTOR                                 //
	//----------------------------------------------------------------------------//

	/**
	 * Constructor
	 */
	public XfslActionListener(Xfsl frame) {
		this.frame = frame;
	}

	//----------------------------------------------------------------------------//
	//                             M�TODOS P�BLICOS                               //
	//----------------------------------------------------------------------------//
	
	/**
	 * Interfaz ActionListener
	 */
	public void actionPerformed(ActionEvent e) {
		String command = e.getActionCommand();
		if(command.equals("Close")) frame.close();
		else if(command.equals("Save")) frame.save();
		else if(command.equals("Apply")) frame.apply();
		else if(command.equals("Reload")) frame.reload();
		else if(command.equals("Run")) frame.run();
	}

}
